using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Xml.Serialization;

namespace WozLib.UI.Ink.SketchProperties
{
  public class LineGeometrySketchProperty : SketchProperty
  {


    [XmlElement("StartPoint")]
    public Point StartPoint
    {
      get { return _StartPoint; }
      set { _StartPoint = value; }
    } private Point _StartPoint;

    [XmlElement("EndPoint")]
    public Point EndPoint
    {
      get { return _EndPoint; }
      set { _EndPoint = value; }
    } private Point _EndPoint;

    public LineGeometrySketchProperty(Point startPoint, Point endPoint, WozPropertyType wozPropertyType)
      : base(wozPropertyType)
    {
      StartPoint = startPoint;
      EndPoint = endPoint;
    }

    public LineGeometrySketchProperty()
      : base()
    {
    }

    public override object Clone()
    {
      return new LineGeometrySketchProperty(StartPoint, EndPoint, this.WozPropertyType);
    }

    /// <summary>
    /// Returns true if .equals on the Data is true
    /// </summary>
    /// <param name="obj"></param>
    /// <returns></returns>
    public override bool Equals(object obj)
    {
      if (obj is LineGeometrySketchProperty && (obj as LineGeometrySketchProperty).StartPoint == StartPoint &&
        (obj as LineGeometrySketchProperty).EndPoint == EndPoint)
      {
        return true;
      }
      else
      {
        return false;
      }
    }
  }
}
